fix: report task output metrics in Spark UI#3999
Merged
comphead merged 3 commits intoapache:mainfrom Apr 22, 2026
Merged
Conversation
comphead
reviewed
Apr 20, 2026
|
|
||
| spark.sparkContext.listenerBus.waitUntilEmpty() | ||
|
|
||
| assert(outputBytes.nonEmpty, "No task reported outputMetrics.bytesWritten") |
Contributor
There was a problem hiding this comment.
Please check the test for input metrics, we def need to ensure number of rows are the same. for bytes we need to have some approximation
Contributor
Author
There was a problem hiding this comment.
Sure, I'll update in next commit. Thanks @comphead for review.
Contributor
Author
There was a problem hiding this comment.
Updated. Now assert recordsWritten with exact equality, and use the existing suite convention for bytes approximation (ratio in 0.7–1.3), consistent with other input-metrics checks in CometTaskMetricsSuite.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Part of #3996
Closes #3608
Rationale for this change
Native Parquet writes executed by Comet were updating SQL metrics (bytes_written, rows_written) but not Spark task-level OutputMetrics. Spark UI Stages displays the Output column from task metrics, so native write stages could show empty output even when files were successfully written.
This change aligns native write metrics reporting with Spark UI expectations by propagating native write totals to task-level output metrics.
What changes are included in this PR?
How are these changes tested?
Added/ran targeted ScalaTest
